package com.gsafety.xuzhou.util

import android.content.Context
import android.graphics.drawable.Drawable
import android.net.Uri
import android.widget.ImageView
import com.gsafety.libraryktx.util.GlideUtils
import com.lxj.matisse.engine.ImageEngine

class Glide4Engine : ImageEngine {
    override fun loadImage(context: Context, resize: Int, resizeY: Int, imageView: ImageView, uri: Uri) {
        GlideUtils.getInstance()?.displayImage(uri, imageView)
    }

    override fun loadGifImage(context: Context?, resizeX: Int, resizeY: Int, imageView: ImageView, uri: Uri) {
        GlideUtils.getInstance()?.displayImage(uri, imageView)
    }

    override fun supportAnimatedGif(): Boolean {
        return true
    }

    override fun loadGifThumbnail(context: Context?, resize: Int, placeholder: Drawable?, imageView: ImageView, uri: Uri) {
        GlideUtils.getInstance()?.displayImage(uri, imageView)
    }

    override fun loadThumbnail(context: Context, resize: Int, placeholder: Drawable, imageView: ImageView, uri: Uri) {
        GlideUtils.getInstance()?.displayImage(uri, imageView)
    }
}